﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/MasterPage/Site1.Master" AutoEventWireup="true" CodeBehind="WeightTypeManager.aspx.cs" Inherits="TARS.AdminCP.WeightType" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSkinManager ID="Metro" runat="server" Skin="Hay" />
        <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="true" />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="cboFilterBranchesZone">
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cboFilterCarrierTypeName">
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                </telerik:RadAjaxManager>
            <label for="NamesDDL"><b>Filter:</b></label>
         <div style="margin-top: 5px;margin-bottom:15px;">
            <telerik:RadComboBox Width="250px" DataTextField="ZoneName" DataValueField="ID" EnableLoadOnDemand="True" ID="cboFilterBranchesZone" runat="server" Skin="Metro" AutoPostBack="true" OnSelectedIndexChanged="cboFilterBranchesZone_SelectedIndexChanged"></telerik:RadComboBox><br />
             <telerik:RadComboBox Width="250px" DataTextField="CarrierTypeName" DataValueField="ID" EnableLoadOnDemand="True" ID="cboFilterCarrierTypeName" runat="server" Skin="Metro" AutoPostBack="true" OnSelectedIndexChanged="cboFilterCarrierTypeName_SelectedIndexChanged" Enabled="False"></telerik:RadComboBox>
             </div>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TARS_DeliveryConnectionString %>" SelectCommand="SELECT [ZoneName], [ID] FROM [t_BrachesZone] WHERE ([Active] = @Active)">
                <SelectParameters>
                    <asp:Parameter DefaultValue="True" Name="Active" Type="Boolean" />
                </SelectParameters>
            </asp:SqlDataSource>
            <telerik:RadGrid ID="RadGrid1" runat="server" EnableLinqExpressions="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" 
                AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateEditColumn="True" 
                CellSpacing="0" GridLines="None" Skin="Hay" OnInsertCommand="RadGrid1_InsertCommand" 
                OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound" OnUpdateCommand="RadGrid1_UpdateCommand">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <MasterTableView FilterExpression="([Active] = True)" AutoGenerateColumns="False" CommandItemDisplay="TopAndBottom">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="NewID" Visible="false" EmptyDataText="" FilterControlAltText="Filter NewID column" HeaderText="NewID" SortExpression="NewID" UniqueName="NewID" EditFormHeaderTextFormat="">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn DataField="ZoneName" AllowFiltering="false" FilterControlAltText="Filter ZoneName column" HeaderText="Branches Zone" SortExpression="ZoneName" UniqueName="ZoneName">
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="cboBranchesZone" EnableLoadOnDemand="True" 
                                                        DataSourceID="SqlDataSource1" DataValueField="ID" DataTextField="ZoneName" AutoPostBack="true"
                                                        HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px"
                                                        OnSelectedIndexChanged="cboBranchesZone_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="ZoneNameLabel" runat="server" Text='<%# Eval("ZoneName") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="CarrierTypeName" AllowFiltering="false"  FilterControlAltText="Filter CarrierTypeName column" HeaderText="Carrier Type's Name" SortExpression="CarrierTypeName" UniqueName="CarrierTypeName">
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="cboCarrierType" OnSelectedIndexChanged="cboCarrierType_SelectedIndexChanged" EnableLoadOnDemand="True" AutoPostBack="true" HighlightTemplatedItems="true" Height="140px" Width="220px" DropDownWidth="420px">
                            </telerik:RadComboBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="CarrierTypeNameLabel" runat="server" Text='<%# Eval("CarrierTypeName") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="WeightTypeName" FilterControlAltText="Filter WeightTypeName column" HeaderText="Weight Type's Name" SortExpression="WeightTypeName" UniqueName="WeightTypeName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="PerKg" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" DataType="System.Boolean" FilterControlAltText="Filter PerKg column" HeaderText="Per Kg" SortExpression="PerKg" UniqueName="PerKg">
                        </telerik:GridCheckBoxColumn>
                        <telerik:GridCheckBoxColumn DataField="Active" CurrentFilterFunction="EqualTo" CurrentFilterValue="True" AutoPostBackOnFilter="true" DataType="System.Boolean" FilterControlAltText="Filter Active column" HeaderText="Active" SortExpression="Active" UniqueName="Active">
                        </telerik:GridCheckBoxColumn>
                        <telerik:GridDateTimeColumn DataField="CreatedTime" EmptyDataText="" FilterControlAltText="Filter CreatedTime column" HeaderText="Created Time" PickerType="DateTimePicker" SortExpression="CreatedTime" UniqueName="CreatedTime" EditFormHeaderTextFormat="">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridDateTimeColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <EditItemStyle BackColor="LightGreen" />
                    <PagerStyle PageSizeControlType="RadComboBox" />
                </MasterTableView>
                <PagerStyle Mode="NextPrevNumericAndAdvanced" PageSizeControlType="RadComboBox" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
</asp:Content>
